##! /bin/bash
#! bash
#
#  $Id: traduit.sh 3 2010-05-27 16:25:49Z alistair.mills@btinternet.com $
#
# set -x
export TARGET='Articles de La Guinguette - Traductions'
. ./defines.sh
cat > $2 <</eof

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta name="description" content="French Lessons">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Articles de La Guinguette - Traductions</title>
    <link href="../../style.css" rel="stylesheet" type="text/css">

    <script src="sorttable.js" language="JavaScript" type="text/javascript"></script>
    <style type="text/css">
    <!--
    p {
        color: Black;
    }
    -->
    </style>

</head>


<body bgcolor="#FFFFFF" background="../back.gif" text="#008000" link="#0000FF" vlink="#0000FF">
<a href="../index.html"><img src="../../up.gif" alt="up" width="36" height="18"></a>
<h1>Articles de La Guinguette - Traductions </h1>
<br><a title="chercher" href="_zoom/search.php">Chercher les traductions</a><br><br>
<a title="Articles de La Guinguette &agrave; traduire" href="traductions.html">Articles de La Guinguette - Articles &agrave; traduire </a><br><br>
<a title="index (php)" href="index.php"> Index (php)</a><br><br>
<a title="index (html)" href="index.html">Index (htm)</a><br><br>
<a title="statistiques (php)" href="stats.php">Statistiques (php)</a><br><br>
<a title="statistiques (html)" href="stats.html">Statistiques (htm)</a><br><br>
<p>Cliquer sur le titre d'un colon pour tirer les donn&eacute;es du tableau.</p>

<table class="sortable" border="1">

<thead>
<tr>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Num&eacute;ro</u></th>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Item</u></th>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Ann&eacute;e</u></th>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Mois</u></th>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Cat&eacute;gorie</u></th>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Title</u></th>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Traduction</u></th>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Original</u></th>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Traducteur</u></th>
<th align="left"    bgcolor="white" title="cliquer pour tirer"><u>Mise &agrave; jour</u></th>
<th align="right"   bgcolor="white" title="cliquer pour tirer"><u>Taille</u></th></tr>
</thead>

<tbody>

/eof


### Main script stars here ###
# Store file name  here
FILE=$1
export prepare='<font color="#a0a0a0"> On la pr&eacute;pare </font>'
export   total=0
  . ./defines.sh
  . ./keys.sh

while read year mon cat size url key trans line
do
  if [ "$line" != "$title_line" -a "$year" != "$comment_line" ]
  then
    . ./categories.sh
    . ./months.sh
    . ./translators.sh
    export      tra=${year}_${mon}_${cat}
    export    INPUT=${year}_${mon}_${cat}.html
    export     INPU=${year}_${mon}_${cat}.htm

# echo Trying $INPUT - $line
    if [ "$line" != "" -a "$key" = "$done"  -a -f $INPUT ]
    then
      export       total=`expr $total + 1`
      export change_date=`cat  $last$INPU`
      export  change_key=`cat $key_d$INPU`

      export       item=${year}${mon}${cat}
      export        tot=`printf '%.3i' $total`

      echo Found $key: $tot - $INPUT - $line
      cat >> $2 <</eof

<tr>
<td>$tot</td>
<td>$item</td>
<td>$year</td>
<td sorttable_customkey="$mon">$month</td>
<td>$category</td>
<td>$line</td>
<td sorttable_customkey="$item"><a title="traduction" href="$tra.html"> Cliquer ici</a></td>
<td sorttable_customkey="$item"><a title="original" href="$url" target="_blank">Cliquer ici</a></td>
<td>$translator</td>
<td sorttable_customkey="$change_key">$change_date</td>
<td align="right">$size</td>
</tr>

/eof

    fi

    if [ "$line" != "" -a "$key" = "$in_progress" -a "$year" != "$comment_line" -a -f $INPUT ]
    then
      export       total=`expr $total + 1`
      export change_date=`cat  $last$INPU`
      export  change_key=`cat $key_d$INPU`
      export        item=${year}${mon}${cat}
      export         tot=`printf '%.3i' $total`

      echo Found $key: $tot - $INPUT - $line
      cat >> $2 <</eof

<tr>
<td>$tot</td>
<td>$item</td>
<td>$year</td>
<td sorttable_customkey="$mon">$month</td>
<td>$category</td>
<td>$line</td>
<td sorttable_customkey="00"><a title="traduction" href="$tra.html"> <font color="#a0a0a0">en pr&eacute;paration</font></a></td>
<td sorttable_customkey="$item"><a title="original" href="$url" target="_blank">Cliquer ici</a></td>
<td>$translator</td>
<td sorttable_customkey="00"><font color="#a0a0a0">en pr&eacute;paration</font></td>
<td align="right">$size</td>
</tr>

/eof

    fi

    if [ "$line" != "" -a "$key" = "$not_started" -a "$year" != "$comment_line" -a -f $INPUT ]
    then
      export       total=`expr $total + 1`
      export change_date=`cat  $last$INPU`
      export  change_key=`cat $key_d$INPU`
      export        item=${year}${mon}${cat}
      export         tot=`printf '%.3i' $total`

      echo Found $key: $tot - $INPUT - $line
      cat >> $2 <</eof

<tr>
<td>$tot</td>
<td>$item</td>
<td>$year</td>
<td sorttable_customkey="$mon">$month</td>
<td>$category</td>
<td>$line</td>
<td sorttable_customkey="00"><a title="traduction" href="$tra.html"> <font color="#a0a0a0">pas disponible</font></a></td>
<td sorttable_customkey="$item"><a title="original" href="$url" target="_blank">Cliquer ici</a></td>
<td>$translator</td>
<td sorttable_customkey="00"><font color="#a0a0a0">pas disponible</font></td>
<td align="right">$size</td>
</tr>

/eof

    fi

  fi

done < $FILE

cat >> $2 <</eof
</tbody>
</table>

<hr>
      <p lang="ENS">With questions or for more information, please contact Alistair Mills <a href="mailto:alistair.mills@btinternet.com"> alistair.mills@btinternet.com</a><br>
      Updated <!-- #BeginDate format:Sw1 --> $date <!-- #EndDate --></p>
      <hr>
      <a href="http://validator.w3.org/check?uri=referer">
        <img
        src="http://www.w3.org/Icons/valid-html401-blue"
        alt="Valid HTML 4.01 Transitional" height="31" width="88">
      </a>
<hr>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2273668-1";
urchinTracker();
</script>

      </body>
</html>
/eof

#
#
#
